using SpecificationPatternCodeV2.Abstracts;

namespace SpecificationPatternCodeV2.Base
{
	public class EqualsSpecification<T> : CompositeSpecification<T>
	{
		private readonly T _comparator;

		public EqualsSpecification(T comparator)
		{
			_comparator = comparator;
		}

		public override bool IsSatisfiedBy(T candidate)
		{
			return candidate.Equals(_comparator);
		}
	}
}